<!DOCTYPE html>
<html lang="en">

<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Blued质量宣传月</title>

    <!-- Bootstrap Core CSS -->
    <link rel="shortcut icon" href="../../qa/static/images/shouye/QA-Logo.png">
    <link href="../../qa/static/css/bootstrap.min.css" rel="stylesheet">

    <!-- Custom CSS -->
    <link href="../../qa/static/css/chart.css" rel="stylesheet">

    <!-- Morris Charts CSS -->
    <link href="../../qa/static/css/plugins/morris.css" rel="stylesheet">

    <!-- Custom Fonts -->
    <link href="../../qa/static/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
        <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body>
        <div id="page-wrapper">

            <div class="container-fluid">
                <div class="row">
                    <div class="col-lg-12">
                        <h3 class="page-header">Blued发版Bug统计</h3>
                    </div>
                </div>
                <div>
                    <form method= 'get'>
{#                            <div style="float: left;">#}
                        <select name="version" class="form-control" style="width: auto;float: left; margin-left: 5%; margin-right: 5%">
                            <option value= 3 {% if  myversion  == '3' %}selected="selected"{% endif %}>国内版Android</option>
                            <option value= 4 {% if  myversion  == '4' %}selected="selected"{% endif %}>国内版IOS</option>
                            <option value= 13 {% if  myversion  == '13' %}selected="selected"{% endif %}>国际版Android</option>
                            <option value= 12 {% if  myversion  == '12' %}selected="selected"{% endif %}>国际版IOS</option>
                        </select>
                        <select name="build" class="form-control" style="width: auto;float: left;">
                        <option value="trunk">Trunk</option>
                            {% for x in  build  %}
                                <option value={{ x }} {% if  myselected  == x %}selected="selected"{% endif %}>{{ x }}</option>
                            {% endfor %}
                        </select>
                        <input type="submit" id='vbadge' class='btn btn-info' value='查询' style="width: auto;float: left;margin-left: 5%">
{#                            </div>#}
                    </form>
                </div>
                <div class="row">
                    <div class="col-lg-12">
{#                        <p class="lead">Android:</p>#}
{#                        <div class="panel panel-green">#}
                        <div class="panel-body" style="margin-top: 15%">
                            <div class="flot-chart_pie">
                                <div class="flot-chart-content" id="flot-pie-chart"></div>
                            </div>
                        </div>
                        <div class="table-responsive" style="margin-top: 10%">
                            <table class="table table-bordered table-hover table-striped" style="height:10px;">
                                <thead>
                                    <tr class="info">
                                        <th class = 'col-lg-2' style="text-align: center">已解决</th>
                                        <th class = 'col-lg-3' style="text-align: center;">未解决</th>
                                        <th class = 'col-lg-1' style="text-align: center">设计如此</th>
                                        <th class = 'col-lg-2' style="text-align: center">无法重现</th>
                                        <th class = 'col-lg-2' style="text-align: center">其他原因</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <tr>
                                        <td style="text-align: center">{{ fixed }}</td>
                                        <td style="text-align: center">{{ noresolve }}</td>
                                        <td style="text-align: center">{{ bydesign }}</td>
                                        <td style="text-align: center">{{ notrepro }}</td>
                                        <td style="text-align: center">{{ other }}</td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
                <!-- /.row -->

{#                <div class="row">#}
{#                    <div class="col-lg-12">#}
{#                        <div class="panel panel-primary">#}
{#                            <div class="panel-heading">#}
{#                                <h3 class="panel-title"><i class="fa fa-long-arrow-right"></i> Bar Graph with Tooltips</h3>#}
{#                            </div>#}
{#                            <div class="panel-body">#}
{#                                <div class="flot-chart">#}
{#                                    <div class="flot-chart-content" id="flot-bar-chart"></div>#}
{#                                </div>#}
{#                                <div class="text-right">#}
{#                                    <a href="#">View Details <i class="fa fa-arrow-circle-right"></i></a>#}
{#                                </div>#}
{#                            </div>#}
{#                        </div>#}
{#                    </div>#}
{#                </div>#}
{#                <div class="row">#}
{#                    <div class="col-lg-12">#}
{#                        <div class="panel panel-green">#}
{#                            <div class="panel-heading">#}
{#                                <h3 class="panel-title"><i class="fa fa-bar-chart-o"></i> Area Line Graph Example with Tooltips</h3>#}
{#                            </div>#}
{#                            <div class="panel-body">#}
{#                                <div id="morris-area-chart"></div>#}
{#                            </div>#}
{#                        </div>#}
{#                    </div>#}
{#                </div>#}
                <!-- /.row -->

                <div class="row">
{#                    <div class="col-lg-12">#}
{#                        <div class="panel panel-yellow">#}
{#                            <div class="panel-heading">#}
{#                                <h3 class="panel-title"><i class="fa fa-long-arrow-right"></i> Donut Chart Example</h3>#}
{#                            </div>#}
{#                            <div class="panel-body">#}
{#                                <div id="morris-donut-chart"></div>#}
{#                                <div class="text-right">#}
{#                                    <a href="#">View Details <i class="fa fa-arrow-circle-right"></i></a>#}
{#                                </div>#}
{#                            </div>#}
{#                        </div>#}
{#                    </div>#}
                    <div class="col-lg-12">
                        <div class="row">
                            <div class="col-lg-12">
                                <h3 class="page-header">Blued收敛曲线</h3>
                            </div>
                        </div>
                        <div style="margin-top: 5%">
                            <div id="morris-line-chart">
                            </div>
                        </div>
                    </div>
                    <div class="col-lg-12" style="margin-top: 5%">
                        <div class="panel panel-primary">
                            <div class="panel-heading">
                                <h3 class="panel-title"><i class="fa fa-long-arrow-right"></i> Bug优先级统计</h3>
                            </div>
                            <div class="panel-body">
                                <div id="morris-bar-chart"></div>
{#                                <div class="text-right">#}
{#                                    <a href="#">View Details <i class="fa fa-arrow-circle-right"></i></a>#}
{#                                </div>#}
                            </div>
                        </div>
                    </div>
                </div>
                <!-- /.row -->

            <!-- /.container-fluid -->

        </div>
        <!-- /#page-wrapper -->

    </div>
    <!-- /#wrapper -->

    <!-- jQuery -->
    <script src="../../qa/static/js/jquery.js"></script>

    <!-- Bootstrap Core JavaScript -->
    <script src="../../qa/static/js/bootstrap.min.js"></script>

    <!-- Morris Charts JavaScript -->
    <script src="../../qa/static/js/plugins/morris/raphael.min.js"></script>
    <script src="../../qa/static/js/plugins/morris/morris.min.js"></script>
    <script src="../../qa/static/js/plugins/morris/morris-data.js"></script>

    <!-- Flot Charts JavaScript -->
    <!--[if lte IE 8]><script src="js/excanvas.min.js"></script><![endif]-->
    <script src="../../qa/static/js/plugins/flot/jquery.flot.js"></script>
    <script src="../../qa/static/js/plugins/flot/jquery.flot.tooltip.min.js"></script>
    <script src="../../qa/static/js/plugins/flot/jquery.flot.resize.js"></script>
    <script src="../../qa/static/js/plugins/flot/jquery.flot.pie.js"></script>
    <script src="../../qa/static/js/plugins/flot/flot-data.js"></script>
    <script>
        function submitForm(){
        //获取form表单对象
            var form = document.getElementById("build");
            form.submit();//form表单提交
        }
        $(function() {
            var data = [{
                label: "无法复现",
                data: {{ notrepro }}
            },{
                label: "设计如此",
                data: {{ bydesign }}
            }, {
                label: "未解决",
                data: {{ noresolve }}
            },
            {
                label: "已解决",
                data: {{ fixed }}
            },{
                label: "其他原因",
                data: {{ other }}
            }];
            var plotObj = $.plot($("#flot-pie-chart"), data, {
                series: {
                    pie: {
                        show: true
                    }
                },
                grid: {
                    hoverable: true
                },
                tooltip: true,
                tooltipOpts: {
                    content: "%p.0%, %s", // show percentages, rounding to 2 decimal places
                    shifts: {
                        x: 20,
                        y: 0
                    },
                    defaultTheme: false
                }
            });

        });
        $(function() {

            // Area Chart
{#            Morris.Area({#}
{#                element: 'morris-area-chart',#}
{#                data: [{#}
{#                    period: '2010 Q1',#}
{#                    iphone: 2666,#}
{#                    ipad: null,#}
{#                    itouch: 2647#}
{#                }, {#}
{#                    period: '2010 Q2',#}
{#                    iphone: 2778,#}
{#                    ipad: 2294,#}
{#                    itouch: 2441#}
{#                }, {#}
{#                    period: '2010 Q3',#}
{#                    iphone: 4912,#}
{#                    ipad: 1969,#}
{#                    itouch: 2501#}
{#                }, {#}
{#                    period: '2010 Q4',#}
{#                    iphone: 3767,#}
{#                    ipad: 3597,#}
{#                    itouch: 5689#}
{#                }, {#}
{#                    period: '2011 Q1',#}
{#                    iphone: 6810,#}
{#                    ipad: 1914,#}
{#                    itouch: 2293#}
{#                }, {#}
{#                    period: '2011 Q2',#}
{#                    iphone: 5670,#}
{#                    ipad: 4293,#}
{#                    itouch: 1881#}
{#                }, {#}
{#                    period: '2011 Q3',#}
{#                    iphone: 4820,#}
{#                    ipad: 3795,#}
{#                    itouch: 1588#}
{#                }, {#}
{#                    period: '2011 Q4',#}
{#                    iphone: 15073,#}
{#                    ipad: 5967,#}
{#                    itouch: 5175#}
{#                }, {#}
{#                    period: '2012 Q1',#}
{#                    iphone: 10687,#}
{#                    ipad: 4460,#}
{#                    itouch: 2028#}
{#                }, {#}
{#                    period: '2012 Q2',#}
{#                    iphone: 8432,#}
{#                    ipad: 5713,#}
{#                    itouch: 1791#}
{#                }],#}
{#                xkey: 'period',#}
{#                ykeys: ['iphone', 'ipad', 'itouch'],#}
{#                labels: ['iPhone', 'iPad', 'iPod Touch'],#}
{#                pointSize: 2,#}
{#                hideHover: 'auto',#}
{#                resize: true#}
{#            });#}

            // Donut Chart
{#            Morris.Donut({#}
{#                element: 'morris-donut-chart',#}
{#                data: [{#}
{#                    label: "Download Sales",#}
{#                    value: 12#}
{#                }, {#}
{#                    label: "In-Store Sales",#}
{#                    value: 30#}
{#                }, {#}
{#                    label: "Mail-Order Sales",#}
{#                    value: 20#}
{#                }],#}
{#                resize: true#}
{#            });#}
            // Line Chart

            Morris.Line({

                // ID of the element in which to draw the chart.
                element: 'morris-line-chart',
                // Chart data records -- each entry in this array corresponds to a point on
                // the chart.
                data: [
                    {
                    d: '{{ date4 }}',
                    submit: {{ submit4 }},
                    fixed:{{ fixed4 }},
                    bydesign:{{ bydesign4 }},
                    notrepro:{{ notrepro4 }},
                }, {
                    d: '{{ date3 }}',
                    submit: {{ submit3 }},
                    fixed:{{ fixed3 }},
                    bydesign:{{ bydesign3 }},
                    notrepro:{{ notrepro3 }},
                }, {
                    d: '{{ date2 }}',
                    submit: {{ submit2 }},
                    fixed:{{ fixed2 }},
                    bydesign:{{ bydesign2 }},
                    notrepro:{{ notrepro2 }},
                }, {
                    d: '{{ date1 }}',
                    submit: {{ submit1 }},
                    fixed:{{ fixed1 }},
                    bydesign:{{ bydesign1 }},
                    notrepro:{{ notrepro1 }},
                }, {
                    d: '{{ date0 }}',
                    submit: {{ submit0 }},
                    fixed:{{ fixed0 }},
                    bydesign:{{ bydesign0 }},
                    notrepro:{{ notrepro0 }},
                }
                ],
                // The name of the data record attribute that contains x-visitss.
                xkey: 'd',
                // A list of names of data record attributes that contain y-visitss.
                ykeys: ['submit','fixed','bydesign','notrepro'],
                // Labels for the ykeys -- will be displayed when you hover over the
                // chart.
                labels: ['submit','fixed','bydesign','notrepro'],
                // Disables line smoothing
                barRatio: 0.8,
                xLabelAngle: 35,
                smooth: false,
                resize: true
            });

            // Bar Chart
            Morris.Bar({
                element: 'morris-bar-chart',
                data: [{
                    device: '一级Bug',
                    geekbench: 136
                }, {
                    device: '二级Bug',
                    geekbench: 137
                }, {
                    device: '三级Bug',
                    geekbench: 275
                }, {
                    device: '四级Bug',
                    geekbench: 380
                }],
                xkey: 'device',
                ykeys: ['geekbench'],
                labels: ['数量'],
                barRatio: 0.4,
                xLabelAngle: 35,
                hideHover: 'auto',
                resize: true
            });


        });

    </script>

</body>

</html>
